#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);cin.tie(nullptr);
    int T; cin >> T;
    while(T--){
        int N; cin >> N;
        vector<int> v(N, 0);
        int sum = 0, ans = 0;
        long long pro = 1;
        for (int i = 0; i < N; ++i) {
            int t; cin >> t;
            if(t == 0){
                sum += 1;
                ans += 1;
            }
            else{
                sum += t;
                pro *= t;
            }
        }
        if(sum == 0) ans++;
        cout << ans << "\n";
    }
    return 0;
}